package com.qiyu.canal.client;

import com.alibaba.otter.canal.protocol.CanalEntry;

import java.io.Serializable;

/**
 * @Author idea
 * @Date created in 10:17 上午 2020/8/2
 */
public class CanalMsgObject implements Serializable {

    private static final long serialVersionUID = 197852299630621077L;

    private long timestamp;

    private int eventType;

    private CanalEntry.RowData rowData;

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public CanalEntry.RowData getRowData() {
        return rowData;
    }

    public void setRowData(CanalEntry.RowData rowData) {
        this.rowData = rowData;
    }

    public int getEventType() {
        return eventType;
    }

    public void setEventType(int eventType) {
        this.eventType = eventType;
    }

    public CanalMsgObject(CanalEntry.RowData rowData, int eventType) {
        this.timestamp = System.currentTimeMillis();
        this.rowData = rowData;
        this.eventType = eventType;
    }

    public CanalMsgObject() {
    }

    @Override
    public String toString() {
        return "CanalMsgObject{" +
                "timestamp=" + timestamp +
                ", eventType=" + eventType +
                ", rowData=" + rowData +
                '}';
    }
}
